package com.xzh.wms.controller;

import cn.hutool.core.thread.ThreadUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.xzh.wms.entity.*;
import com.xzh.wms.service.ProductService;

import java.util.List;

/**
 * ;(206_product)控制层
 * @author : heimi
 * @date : 2024-11-10
 */
@RestController
@RequestMapping("/api/product")
public class ProductController{

    @Autowired
    private ProductService productService;
    
    /** 
     * 查询接口
     */
     @GetMapping
     public List<Product> select(ProductQuery query){
        return productService.select(query);
    }
    
    @PostMapping 
    public Integer insert(@RequestBody Product product){

       return productService.insert(product);
    }
    
    @PutMapping 
    public Integer update(@RequestBody Product product){
        return productService.update(product);
    }
    
    @DeleteMapping
    public Integer delete(Integer id){
        return productService.delete(id);
    }
}